<div class="card-header  text-white" xmlns="http://www.w3.org/1999/html">
    <div class="input-group col-md-12 col-xl-6">
        <input type="text" class="form-control" id="searchName" placeholder="输入器材名称进行搜索">
        <span class="input-group-btn">
			<button class="btn btn-secondary" type="button" id="searchNameBtn" >
				<i class="fa fa-search" aria-hidden="true"></i>
			</button>
		</span>

    </div>
</div>

<div id="mainContainer" class="container" >
    <div id="mainContainerRepleace" class="row">
        <table class="table table-striped">
            <thead>
            <tr>
                <th data-field="repairsId" >ID</th>
                <th data-field="equipmentName">器材名称</th>
                <th data-field="equipmentSpecifications">器材规格</th>
                <th data-field="equipmentCount">器材数量</th>
                <th data-field="equipmentPrice">器材价格</th>
                <th data-field="totalPrice">报修价格</th>
                <th data-field="repairsState">审核状态</th>
                <th data-field="operation">操作</th>
            </tr>
            </thead>
            <tbody>
            <tr th:each="er : ${equipmentRepairs}">
                <th th:text="${er.repairId}">...</th>
                <td th:text="${er.equipmentInfo.equipmentName}">...</td>
                <td th:text="${er.equipmentInfo.equipmentSpecifications}">...</td>
                <td th:text="${er.repairCount}">...</td>
                <td th:text="${er.equipmentInfo.equipmentPrice}">...</td>
                <td th:text="${er.repairPrice}">...</td>
                <td>
                    <span class="text-secondary" th:if="${er.repairState=='0'}">待审核</span>
                    <span class="text-success" th:if="${er.repairState=='1'}">已通过</span>
                    <span class="text-danger" th:if="${er.repairState=='2'}">已拒绝</span>
                    <span class="text-primary" th:if="${er.repairState=='3'}">已完成</span>
                </td>
                <td>
                    <button  class="btn btn-danger btn-sm" id="undo-equipmentRepairs" th:if="${er.repairState=='0'}" data-th-attr="repairId=${er.repairId},teacherNumber=${er.applyTeacher.teacherNumber}">
                        <i class="fa fa-undo" aria-hidden="true">撤销</i>
                    </button>
                    <button  class="btn btn-primary btn-sm" id="ok-equipmentRepairs" th:if="${er.repairState=='1'}" data-toggle="modal"  data-target="#flipFlop"data-th-attr="repairId=${er.repairId},teacherNumber=${er.applyTeacher.teacherNumber}">
                        <i class="fa fa-check" aria-hidden="true">完成</i>
                    </button>
                </td>
            </tr>
            </tbody>
        </table>
        <div th:replace="~{fragments/page :: page}">...</div>
    </div>
</div>
<!-- The modal -->
<div class="modal fade" id="flipFlop" tabindex="-1" role="dialog"
     aria-labelledby="flipFlop"  aria-hidden="true">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <h4 class="modal-title" id="repairTitle">报修价格</h4>
                <button type="button" class="close" data-dismiss="modal"
                        aria-label="Close" id="repairDialogClose">
                    <span aria-hidden="true" >&times;</span>
                </button>
            </div>
            <form id="repairForm">
            </form>
        </div>
    </div>
</div>
<script src="../../js/equipments/repairs.js" th:src="@{/js/equipments/repairs.js}"></script>
